package stattracker;

import java.util.TreeMap;
public class Halo3Achievements implements java.io.Serializable
{
	public static final String I_CANT_QUIT_YOU = "I Can't Quit You.";
	public static final String WAIT_HOW_MANY_ARE_ON_A_TEAM = "Wait, How Many Are On A Team?";
	public static final String THE_DEVELOPERS = "The Brains, The Ideas, and The Canadian";
	public static final String DOES_HE_EVEN_HAVE_AN_IPHONE = "Does He Even Have An iPhone?";
	public static final String WHATS_A_JABRONIE = "What's a Jabronie?";
	public static final String WHO_IS_STOCKER_EH = "Who the F#$% is Stocker eh?";
	public static final String ITS_OVER_9000 = "It's Over 9000!";
	public static final String EH_TU_BRUTE = "Eh tu, Brute?";
	public static final String OUCH_MY_BACK_HURTS = "Ouch! My Back Hurts!";
	public static final String SNEAKY_BEAVER = "Sneaky Beaver";
	public static final String I_GOT_YOUR_SIX = "I got your six.";
	public static final String GUNS_DONT_KILL = "Guns don't kill people, I kill people.";
	public static final String ANTI_PERFECTION = "Anti-Perfection";
	public static final String SERIOUSLY_SERIOUS = "Seriously?! Serious.";
	public static final String CANT_TOUCH_THIS = "Can't Touch This";
	public static final String BEAST_MODE_ACTIVATE = "Beast Mode, ACTIVATE!";
	public static final String SO_SHINY = "So Shiny...";
	public static final String CANT_PLAY_TOO_FULL = "Can't Play, Too Full";
	public static final String PEST_CONTROL = "Pest Control";
	public static final String DID_THEY_QUIT = "Did They Quit?";
	public static final String FOUR_DOWN = "Four Down";
	
	private static final long serialVersionUID = 1L;
	private TreeMap<String, Achievement> achievements;
	public Halo3Achievements()
	{
		achievements = new TreeMap<String, Achievement>();
		setList();
	}
	
	public TreeMap<String, Achievement> getAchievements()
	{
		return achievements;
	}
	
	public void unlock(String name, String gameURL)
	{
		if(achievements.containsKey(name))
			achievements.get(name).achieved(gameURL);
		else
			new ErrorMessage("Undefined Achievement: " + name);
	}
	
	public boolean got(String name)
	{
		if(achievements.containsKey(name))
			return achievements.get(name).isUnlocked();
		else
		{
			new ErrorMessage("Undefined Achievement: " + name);
			return false;
		}
	}
	
	public void addNewAchievement(Achievement newAch)
	{
		achievements.put(newAch.getTitle(), newAch);
	}
	
	public boolean hasAchievement(String key)
	{
		return achievements.containsKey(key);
	}
	
	private void setList()
	{
		achievements.put(FOUR_DOWN, 
				new Achievement(AchievementGroup.MLG, FOUR_DOWN, "Get an Extermination in the MLG playlist.", "AchievementImages/extermination.gif", false));
		achievements.put(DID_THEY_QUIT, 
				new Achievement(AchievementGroup.DIFFICULT, DID_THEY_QUIT, "Get a positive 30 kill to death spread in matchmaking.", "AchievementImages/extermination.gif", false)); //1
		achievements.put(PEST_CONTROL, 
				new Achievement(AchievementGroup.MLG, PEST_CONTROL, "Accumulate 10 Exterminations in the MLG playlist.", "AchievementImages/extermination.gif", false)); //2
		achievements.put(CANT_PLAY_TOO_FULL, 
				new Achievement(AchievementGroup.FUN, CANT_PLAY_TOO_FULL, "Get Five Steaktacular medals in a row in matchmaking.", "AchievementImages/extermination.gif", false)); //3
		achievements.put(SO_SHINY, 
				new Achievement(AchievementGroup.DIFFICULT, SO_SHINY, "Get at least one of every possible medal.", "AchievementImages/Collector.gif", false)); //4
		achievements.put(BEAST_MODE_ACTIVATE,
				new Achievement(AchievementGroup.DIFFICULT, BEAST_MODE_ACTIVATE, "Go +20 or more and have 20 or more assists in a matchmade game.", "AchievementImages/extermination.gif", false)); //5
		achievements.put(CANT_TOUCH_THIS,
				new Achievement(AchievementGroup.DIFFICULT, CANT_TOUCH_THIS, "Get a ranked Invincible! medal.", "AchievementImages/extermination.gif", false)); //6
		achievements.put(SERIOUSLY_SERIOUS, 
				new Achievement(AchievementGroup.CRAZY, SERIOUSLY_SERIOUS, "Accumulate 250,000 kills in Halo 3 multiplayer (Matchmaking and Customs).", "AchievementImages/SoSerious.gif", false)); //7
		achievements.put(ANTI_PERFECTION,
				new Achievement(AchievementGroup.RANDOM, ANTI_PERFECTION, "Get zero kills and 15 or more deaths in matchmaking.", "AchievementImages/bad.gif", false)); //8
		achievements.put(GUNS_DONT_KILL,
				new Achievement(AchievementGroup.FUN, GUNS_DONT_KILL, 
						"Win a ranked matchmade game by using only grenades and melee, no equipment. \n" +
						"(No Swords or Hammer gametypes)", 
						"AchievementImages/GunsDontKillPeople.gif", false)); //name, description, imglocation); //9
		achievements.put(I_GOT_YOUR_SIX,
				new Achievement(AchievementGroup.DIFFICULT, I_GOT_YOUR_SIX, "Get 35 or more assists in a matchmade game.", "AchievementImages/extermination.gif", false)); //10
		achievements.put(SNEAKY_BEAVER,
				new Achievement(AchievementGroup.MLG, SNEAKY_BEAVER, "Get 7 or more assassinations in a MLG playlist game.", "AchievementImages/extermination.gif", false)); //11
		achievements.put(OUCH_MY_BACK_HURTS,
				new Achievement(AchievementGroup.MLG, OUCH_MY_BACK_HURTS, "Get 30 or more kills in a MLG Slayer game.", "AchievementImages/extermination.gif", false)); //12
		achievements.put(EH_TU_BRUTE,
				new Achievement(AchievementGroup.RANDOM, EH_TU_BRUTE, "Get 8 or more betrayals in a matchmade game. (Not Grifball, not Swat)", "AchievementImages/extermination.gif", false)); //13
		achievements.put(ITS_OVER_9000,
				new Achievement(AchievementGroup.RANDOM, ITS_OVER_9000, "Played More than 9000 games of Halo 3 multiplayer.", "AchievementImages/extermination.gif", false)); //name, description, imglocation); //index location
		achievements.put(WHO_IS_STOCKER_EH,
				new Achievement(AchievementGroup.PLAYER, WHO_IS_STOCKER_EH, "You've played with Stocker eh", "AchievementImages/extermination.gif", false)); //name, description, imglocation);
		achievements.put(WHATS_A_JABRONIE,
				new Achievement(AchievementGroup.PLAYER, WHATS_A_JABRONIE, "You've played with Jabronie Man", "AchievementImages/Jabronie.gif", false)); //name, description, imglocation);
		achievements.put(DOES_HE_EVEN_HAVE_AN_IPHONE,
				new Achievement(AchievementGroup.PLAYER, DOES_HE_EVEN_HAVE_AN_IPHONE, "You've played with iPwn on iPhone", "AchievementImages/iPwn.gif", false)); //name, description, imglocation);
		achievements.put(THE_DEVELOPERS,
				new Achievement(AchievementGroup.PLAYER, THE_DEVELOPERS, "You've played with all the developers (Jabronie, iPwn, and Stocker) in a single game.", "AchievementImages/extermination.gif", false)); //name, description, imglocation);
		achievements.put(WAIT_HOW_MANY_ARE_ON_A_TEAM,
				new Achievement(AchievementGroup.MLG, WAIT_HOW_MANY_ARE_ON_A_TEAM, "In the MLG playlist, get a multikill ranked above Overkill.", "AchievementImages/extermination.gif", false)); //name, description, imglocation);
		achievements.put(I_CANT_QUIT_YOU,
				new Achievement(AchievementGroup.FUN, I_CANT_QUIT_YOU, "You've played 3,000 or more multiplayer games, you played one of the first 5,000,000 games, and you played a game after the billionth.", "AchievementImages/extermination.gif", false));
		//achievements.put("",new Achievement(AchievementGroup.RANDOM, "", "", "AchievementImages/extermination.gif", false)); //name, description, imglocation); //index location
		//achievements.put("",new Achievement(AchievementGroup.RANDOM, "", "", "AchievementImages/extermination.gif", false)); //name, description, imglocation); //index location
		//achievements.add(new Achievement("Oh, is this yours?", "Get every flag capture for your team. (Minimum of 3)", "AchievementImages/extermination.gif")); //name, description, imglocation); //index location
	}
}
